<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>"><!-- jsp文件头和头部 -->
    <%@ include file="../../system/admin/top.jsp"%>
</head>
<body>
<div align="left" style="padding-top:20px;padding-bottom:10px;padding-left:600px;font-size:20px;font-family:'黑体'">修改密码</div>



                <!-- 检索  -->
                <form action="student/list.do" method="post" name="Form" id="Form">

                    <!-- 检索  -->


                    <table id="table_report" class="table table-striped table-bordered table-hover">
                       <tr></tr>
                        <tr>
                            <td style="width:160px;height:35px;text-align: right;padding-top: 7px;">原密码:</td>
                            <td style="height:35px;padding-top: 13px;">&nbsp;&nbsp;&nbsp;&nbsp;<input style="width:350px" type="password" name="OLDPASSWORD" id="OLDPASSWORD" maxlength="32" placeholder="这里输入真实姓名" title="原密码"/></td>
                        </tr>
                        <tr>
                            <td style="height:35px;width:160px;text-align: right;padding-top: 7px;">密码:</td>
                            <td style="height:35px;padding-top: 13px;">&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" style="width:350px" type="text" name="PASSWORD" id="PASSWORD"  maxlength="32" placeholder="这里输入密码" title="密码"/></td>
                        </tr>
                        <tr>
                            <td style="height:35px;width:160px;text-align: right;padding-top: 7px;">确认密码:</td>
                            <td style="height:35px;padding-top: 13px;">&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" style="width:350px" type="text" name="chkpwd" id="chkpwd"  maxlength="32" placeholder="确认密码" title="密码"/></td>
                        </tr>
                        <tr>
                            <td style="text-align: left;height:45px;padding-left: 100px;" colspan="10">
                                <a class="btn btn-mini btn-primary" onclick="submit();">提交</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <a class="btn btn-mini btn-danger" href="student/student_info.do">取消</a>
                            </td>
                        </tr>


                    </table>


                </form>

<!-- 返回顶部  -->
<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse">
    <i class="icon-double-angle-up icon-only"></i>
</a>

<!-- 引入 -->
<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>

<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
<!-- 引入 -->
<script type="text/javascript">

    $(top.hangge());

    function submit(){
            var OLDPASSWORD = $("#OLDPASSWORD").val();
            var PASSWORD = $("#PASSWORD").val();
            var chkpwd = $("#chkpwd").val();
            var code = OLDPASSWORD+"#"+PASSWORD;
        if(PASSWORD!=chkpwd) {
            $("#PASSWORD").tips({
                side : 2,
                msg : "两次密码不一致，请重新输入",
                bg : '#FF5080',
                time : 3
            });
            return;
        }


            $.ajax({
                type: "POST",
                url: 'student/chkpwd.do',
                data: {KEYDATA:code,tm:new Date().getTime()},
                dataType:'json',
                cache: false,
                success: function(data){
                    if("success" == data.result){
//                        saveCookie();
                        alert("修改成功");
                        window.location.href="student/student_info.do";
                    }else {
                        $("#OLDPASSWORD").tips({
                            side : 2,
                            msg : "密码有误",
                            bg : '#FF5080',
                            time : 3
                        });
                    }
                }
            });
    }



</script>



</body>
</html>

